from os import path, mkdir
from loguru import logger

base_path = path.dirname(path.abspath(__file__))

log_path = path.join(base_path, '../logs')

if not path.exists(log_path):
    mkdir(log_path)

log_path_error = os.path.join(log_path, f'{time.strftime("%Y-%m-%d")}_error.log')

# 日志简单配置
logger.add(log_path_error, rotation="12:00", retention="5 days", enqueue=True)

__all__ = ["logger"]